
import 'osc_image_entity.dart';
import 'osc_statistics.dart';

class OscAbout {
  List<OscImage> images;
  String href;
  int id;
  int viewCount;
  String title;
  int type;
  String content;
  int commentCount;
  OscStatistics statistics;

  OscAbout({this.images, this.href, this.id, this.viewCount, this.title, this.type, this.content, this.commentCount, this.statistics});

  OscAbout.fromJson(Map<String, dynamic> json) {
    if (json['images'] != null) {
      images = new List<OscImage>();(json['images'] as List).forEach((v) { images.add(new OscImage.fromJson(v)); });
    }
    href = json['href'];
    id = json['id'];
    viewCount = json['viewCount'];
    title = json['title'];
    type = json['type'];
    content = json['content'];
    commentCount = json['commentCount'];
    statistics = json['statistics'] != null ? new OscStatistics.fromJson(json['statistics']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.images != null) {
      data['images'] =  this.images.map((v) => v.toJson()).toList();
    }
    data['href'] = this.href;
    data['id'] = this.id;
    data['viewCount'] = this.viewCount;
    data['title'] = this.title;
    data['type'] = this.type;
    data['content'] = this.content;
    data['commentCount'] = this.commentCount;
    if (this.statistics != null) {
      data['statistics'] = this.statistics.toJson();
    }
    return data;
  }
}